package com.xl.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 *   如果没有这个类 会报错
 *   javax.websocket.DeploymentException: The HTTP response from the server [404]
 *   ServerEndpointExporter 对象的作用是，会扫描所有的服务器端点，把带有  @ServerEndpoint 注解的所有类都添加进来
 *   其实就是扫描所有带有@ServerEndpoint 的bean
 *
 */

@Configuration
public class WebSocketConfig {

    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }

}
